import unittest


class DemoTest(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test01(self):
        print('test01')

    def test02(self):
        print('test02')

    def test03(self):
        print('test03')


if __name__ == '__main__':
    suite = unittest.TestSuite()

    # suite.addTest(DemoTest('test01'))
    # suite.addTest(DemoTest('test02'))

    suite.addTests([DemoTest('test01'), DemoTest('test02')])  # 接收的参数可以是列表, 也可以是元组. 可以查看源代码, 说明是可以迭代的数据类型

    runner = unittest.TextTestRunner()
    runner.run(suite)
    print(suite.countTestCases())
